import { _decorator, Component, Node, game } from 'cc';
import { BaseWxPage } from './BaseWxPage';
const { ccclass, property } = _decorator;

@ccclass('AutoRegist')
export class AutoRegist extends Component {
    @property(BaseWxPage)
    public Pages: BaseWxPage[] = [];
    onLoad() {
        // for (let i = 0; i < this.Pages.length; i++) {
        //     const element = this.Pages[i];
        //     wxsdk.RegistPage(element.node.name, (i) => {
        //         return new Promise<void>((resolve, reject) => {
        //             element.Show(i, resolve)
        //         })
        //     });
        //     element.ClickNode.node.on(Node.EventType.TOUCH_END, element.OnBtnClick, element)
        // }

        // game.addPersistRootNode(this.node);
    }
}

